<template>
  <div>
    <div class="qrcode" ref="qrCodeUrl"></div>
  </div>
</template>

<script>
import QRCode from 'qrcodejs2'
export default {
  data() {
    return {
    };
  },
  created() { },
  computed: {},
  mounted() {

    this.creatQrCode();

  },
  methods: {

    creatQrCode() {
      var qrcode = new QRCode(this.$refs.qrCodeUrl, {
        text: 'https://blog.csdn.net/weixin_42601136', // 需要转换为二维码的内容
        width: 100,
        height: 100,
        colorDark: '#000000',
        colorLight: '#ffffff',
        correctLevel: QRCode.CorrectLevel.H
      })
    },

  }
};
</script>
<style scoped>
/* @import url(); 引入css类 */
</style>